package com.bw.zhuangao5___day002.Fragment.Home.Fragment2;



import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;

import com.bw.mvp.V.BannerFragment;
import com.bw.zhuangao5___day002.R;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;

import java.util.List;


public class BlankFragmentHome2 extends BannerFragment implements MainContions.missview {

    MainPregment mainPregment;
    private RecyclerView maniView;
    BaseTwoAdpter adpter;
    public int dageda=0;
    boolean isooos=true;
    private SmartRefreshLayout maniSmar;
    public int pathis=2;


    @Override
    public int bandLayoud() {
        return R.layout.fragment_blank_fragment_home2;
    }

    @Override
    public void initView() {
        maniView = (RecyclerView) findViewById(R.id.mani_view);
        maniView.setLayoutManager(new StaggeredGridLayoutManager(1,StaggeredGridLayoutManager.VERTICAL));
        mainPregment = new MainPregment(this,new MainModel());
        mainPregment.dogetoos();
    }

    @Override
    public void initDate() {

    }

    @Override
    public void getmissview(List<JavaMain.ResBean.AvatarBean> dataBeans) {
        for (JavaMain.ResBean.AvatarBean  haonide:dataBeans) {
            haonide.setSssmidetaty(++dageda);
            if (dageda==2)
            {
                dageda=0;
            }
        }
        if (adpter==null)
        {
            adpter = new BaseTwoAdpter(dataBeans);
            maniView.setAdapter(adpter);
        }else {
            if (isooos)
            {
                adpter.getData().clear();
            }
            adpter.getData().addAll(dataBeans);
            adpter.notifyDataSetChanged();
        }

    }


}
